Rollup of 14 pull requests#153507
Conversation
both operands of binary operators (including compound assignments like `+=`) were inferred with `ExprIsRead::No`, which prevented divergence detection for place expressions of type `!`. this caused false type mismatches when a function's return type depended on the block diverging after something like `x += *never_ptr` or `let _ = *never_ptr + 1`. both operands of any binary operator are always consumed (read), so this uses `ExprIsRead::Yes` to be consistent with the ordinary assignment and let binding paths.
Signed-off-by: arferreira <arfs.antonio@gmail.com>
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
Example
---
```rust
fn main() {
match 2 {
bar => &bar.l$0
}
}
```
**Before this PR**
```text
sn deref *expr
sn match match expr {}
```
**After this PR**
```text
sn deref *expr
sn let let
sn letm let mut
sn match match expr {}
```
Example
---
```rust
struct Foo { bar: i32, baz: i32 }
impl Foo {
fn foo(&mut $0self) {
self.bar = 5;
}
}
```
**Before this PR**
Assist not applicable
**After this PR**
```rust
struct Foo { bar: i32, baz: i32 }
impl Foo {
fn foo(&mut self) {
let Foo { bar, baz } = self;
*bar = 5;
}
}
```
- Remove unused `ast::make::match_arm_with_guard`
Example
---
```rust
fn main() {
if true {
$0if true
&& false
{
foo()
}
}
}
```
**Before this PR**
```rust
fn main() {
if true {
match true
&& false {
true => foo(),
false => (),
}
}
}
```
**After this PR**
```rust
fn main() {
if true {
match true
&& false
{
true => foo(),
false => (),
}
}
}
```
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5. - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](isaacs/minimatch@v3.1.2...v3.1.5) --- updated-dependencies: - dependency-name: minimatch dependency-version: 3.1.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
fix: Fix wrong confiditon in `Visibility::min`
…er-coercion fix: use `ExprIsRead::Yes` for rhs of binary operators
…is_rust()` with rustc
…yarn/editors/code/minimatch-3.1.5 build(deps-dev): bump minimatch from 3.1.2 to 3.1.5 in /editors/code
Example
---
```rust
macro_rules! m { ($expr:expr) => {$expr}}
enum Test {
A,
B,
C,
}
fn foo(t: Test) {
m!(match t {
Test::A => (),
$0});
}
```
**Before this PR**
Assist not applicable
**After this PR**
```rust
macro_rules! m { ($expr:expr) => {$expr}}
enum Test {
A,
B,
C,
}
fn foo(t: Test) {
m!(match t {
Test::A=>(),
Test::B => ${1:todo!()},
Test::C => ${2:todo!()},$0
});
}
```
This updates the rust-version file to e7d90c6.
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@e7d90c6 Filtered ref: rust-lang/rust-analyzer@bf9b8b9 Upstream diff: rust-lang/rust@c78a294...e7d90c6 This merge was created using https://github.com/rust-lang/josh-sync.
Rustc pull update
rust-analyzer allows AI usage (see rust-lang#21314), but requires contributors to declare usage. This adds a rule file that improves LLM output quality and instructs the LLM to declare usage in commit messages. I've written the rules in CLAUDE.md, but also symlinked it to AGENTS.md so other LLM tools pick it up. ## Rules file contents (1) Instructions for both humans and AIs to declare AI usage. (2) Relevant commands for testing, linting and codegen. Note that I deliberately didn't include an overview of the project structure on a folder-by-folder basis. This can go stale, and there's some evidence that project structure can hurt LLM output quality overall. See the following paper: > Evaluating AGENTS.md: > Are Repository-Level Context Files Helpful for Coding Agents? > https://arxiv.org/pdf/2602.11988 ## Testing I exercised this change with the following contrived prompt. Note that in practice rust-analyzer is hitting review scaling limits for new code actions, but it was easy to test end-to-end. > Add a new code action that replaces the content of a string literal > with the text "banana". ... > commit it This produced a functional code action with both Codex and Claude, and in both cases the commit message mentioned that it was AI generated. Example commit message: Add "Replace string with banana" code action Add a new assist that replaces a string literal's content with "banana" when the cursor is on a STRING token. AI: Generated with Claude Code (claude-opus-4-6). I confirmed that the code action worked by testing a rust-analyzer build in Emacs, and also confirmed that the generated tests looked sensible. ## AI Usage Disclosures I wrote the first draft of the rules file with Opus 4.6, manually reviewed everything.
…nd-range fix: Fix wrong descend range for add_missing_match_arms
…s-rust Fix: align `is_rust()` with rustc by correcting constructor ABI in next solver
|
@bors r+ rollup=never p=5 |
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing a3ac2f2 (parent) -> 80282b1 (this PR) Test differencesShow 119 test diffsStage 0
Stage 1
Stage 2
Additionally, 87 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 80282b130679a654eaa22f028a908c51be53d436 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
📌 Perf builds for each rolled up PR:
previous master: a3ac2f21b3 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
|
Finished benchmarking commit (80282b1): comparison URL. Overall result: ❌✅ regressions and improvements - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -0.1%, secondary 0.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.8%, secondary -0.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 481.299s -> 482.9s (0.33%) |
|
Re: 7bd3c42 ("internal: Define rules for LLMs")
@Wilfred, Edit: It's rust-lang/rust-analyzer#21314; @JonathanBrouwer & @lnicola, please consider using absolute references to issues and pull requests when updating subtrees. What's the relationship between rust-analyzer and this reference Rust implementation? |
|
Thanks, @lnicola, and why is it included as a subtree in this repository? Does rustc anyhow depends on rust-analyzer? If not, is there a consensus on accepting LLM output into rustc's codebase? |
So that it's easier to distribute with the rest of the toolchain.
There is one toolchain component that's built from rust-analyzer code and used by rust-analyzer itself.
I hope it's clear that, since rustc does not depend on rust-analyzer, rust-analyzer is not part of the rustc codebase. But to answer in good faith, Rust is a large project and its contributors will have a diverse set of opinions on any topic. Some are adamantly against LLMs, others find it useful to a certain measure, others might not care at all. If a decision is reached, it will be announced through the usual channels. Now, asking myself in good faith, are you a Rust user? What is your interest in this? |
Thanks!
I work on a downstream distribution (Guix) and I'm just curious of the current status of bootstrapping without involving license laundry. Like Rust, Guix is governed democratically and
We are trying to reach some consensus and information is crucial for us to know if a practical line can be drawn within the packaging side of things. Speaking for myself, I'm against LLM and would also like to know the same thing to avoid it in dependencies of my personal works. |
Successful merges:
rust-analyzersubtree update #153466 (rust-analyzersubtree update)ValTreeKind::Branch(Box<[I::Const]>)changed toList#152593 (Box inValTreeKind::Branch(Box<[I::Const]>)changed toList)offset_of!error recovery #153495 (Fix ICE inoffset_of!error recovery)check_aligntoparse_alignment#153189 (refactor: movecheck_aligntoparse_alignment)Fntrait bounds in pretty printer #153483 (Preserve parentheses aroundFntrait bounds in pretty printer)r? @ghost
Create a similar rollup